<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<div class="t_bar">总投资规模，资金筹措方案，保障措施（万元）</div>
	<table cellpadding="0" class="table01 t_css" id="tblInvestmentTotal_bf"  width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
		<col width="5%"/>
		<col width="5%"/>
		<col width="30%"/>
		<col width="20%"/>
		<col width="20%"/>
		<col width="20%"/>
			<tr style="border:1px solid #B7D1E6">
				<th class="TblHead" align="center">选择</th>
				<th class="TblHead" align="center">序号</th>
				<th class="TblHead" align="center">经费来源 </th> 
				<th class="TblHead" align="center">
					<c:set var="stat_year_one"><x:out select="$xmlData/data/investmenttotals/stat_year_one_value"/></c:set>
					<cpt:select id="stat_year_one" key="stat_year2"  name="stat_year_one" onChange="initControlValue(this.id);" style="width:80%" value="${stat_year_one }"></cpt:select>年
	                <input type="hidden" name="investmenttotals/stat_year_one_value" class="" label="第一个年度" value="<x:out select="$xmlData/data/investmenttotals/stat_year_one_value"/>" />
	                <input type="hidden" name="investmenttotals/stat_year_one_name" value="<x:out select="$xmlData/data/investmenttotals/stat_year_one_name"/>"/>  
				</th>  
				<th class="TblHead" align="center">
					<c:set var="stat_year_two"><x:out select="$xmlData/data/investmenttotals/stat_year_two_value"/></c:set>
					<cpt:select id="stat_year_two" key="stat_year2"  name="stat_year_two" onChange="initControlValue(this.id);" style="width:80%" value="${stat_year_two }"></cpt:select>年
	                <input type="hidden" name="investmenttotals/stat_year_two_value" class="" label="第二个年度" value="<x:out select="$xmlData/data/investmenttotals/stat_year_two_value"/>" />
	                <input type="hidden" name="investmenttotals/stat_year_two_name" value="<x:out select="$xmlData/data/investmenttotals/stat_year_two_name"/>"/>
				</th> 
				<th class="TblHead" align="center">
					<c:set var="stat_year_three"><x:out select="$xmlData/data/investmenttotals/stat_year_three_value"/></c:set>
					<cpt:select id="stat_year_three" key="stat_year2"  name="stat_year_three" onChange="initControlValue(this.id);" style="width:80%" value="${stat_year_three }"></cpt:select>年
	                <input type="hidden" name="investmenttotals/stat_year_three_value" class="" label="第三个年度" value="<x:out select="$xmlData/data/investmenttotals/stat_year_three_value"/>" />
	                <input type="hidden" name="investmenttotals/stat_year_three_name" value="<x:out select="$xmlData/data/investmenttotals/stat_year_three_name"/>"/>
				</th> 
			</tr> 
				<tr  align="center">
						<td align="center" rowspan="2" colspan="2">&nbsp;
							/
						<td >
						<span name="investmenttotals/investmenttotal1/source_name">依托单位自筹</span>
						</td>
						<td >
						<input name="investmenttotals/investmenttotal1/year_one" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第一个年度的依托单位自筹" value="<x:out select="$xmlData/data/investmenttotals/investmenttotal1/year_one"/>"  style="width:80%;text-align: right;">
						</td>
						<td >
						<input name="investmenttotals/investmenttotal1/year_two" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第二个年度的依托单位自筹" value="<x:out select="$xmlData/data/investmenttotals/investmenttotal1/year_two"/>"  style="width:80%;text-align: right;">
						</td>
						<td >
						<input name="investmenttotals/investmenttotal1/year_three" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第三个年度的依托单位自筹" value="<x:out select="$xmlData/data/investmenttotals/investmenttotal1/year_three"/>"  style="width:80%;text-align: right;">
						</td>
					</tr>
					<tr  align="center">
						<td >
						<span name="investmenttotals/investmenttotal2/source_name">银行贷款</span>
						</td>
						<td >
						<input name="investmenttotals/investmenttotal2/year_one" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第一个年度的银行贷款" value="<x:out select="$xmlData/data/investmenttotals/investmenttotal2/year_one"/>" style="width:80%;text-align: right;">
						</td>
						<td >
						<input name="investmenttotals/investmenttotal2/year_two" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第二个年度的银行贷款" value="<x:out select="$xmlData/data/investmenttotals/investmenttotal2/year_two"/>" style="width:80%;text-align: right;">
						</td>
						<td >
						<input name="investmenttotals/investmenttotal2/year_three" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第三个年度的银行贷款" value="<x:out select="$xmlData/data/investmenttotals/investmenttotal2/year_three"/>" style="width:80%;text-align: right;">
						</td>
					</tr>
		</table>
	<table  id="tblInvestmentTotal" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
		<col width="5%"/>
		<col width="5%"/>
		<col width="30%"/>
		<col width="20%"/>
		<col width="20%"/>
		<col width="20%"/>
		<tr style="display: none;"></tr>
			<tr style="display:none"  align="center">
				<td align="center">&nbsp;
					<input type="radio" class="radiobutton" name="selAttendOrg" >
				</td>
				<td align="center">&nbsp;
					<span name="investmenttotals|investmenttotal[0]@seq_no" >[index]</span> 
				</td>
				<td align="center">
				<input name="investmenttotals|investmenttotal[0]|source_name" class=" input_text" label="经费来源" value="" maxlength="50" style="width:80%">
				</td>
				<td align="center">
				<input name="investmenttotals|investmenttotal[0]|year_one" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第一个年度的金额" value="" style="width:80%;text-align: right;">
				</td>
				<td align="center">
				<input name="investmenttotals|investmenttotal[0]|year_two" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第二个年度的金额" value="" style="width:80%;text-align: right;">
				</td>
				<td align="center">
				<input name="investmenttotals|investmenttotal[0]|year_three" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第三个年度的金额" value="" style="width:80%;text-align: right;">
				</td>
			</tr>
			
		<c:set value="0" var="index" scope="page"/>
			<x:forEach select="$xmlData/data/investmenttotals/investmenttotal" var="attendorg">
			
			<c:choose>
				<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
				<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
			</c:choose>
			<tr  align="center">
				<td>&nbsp;
					<input type="radio" class="radiobutton" name="selAttendOrg" >
					<input type="hidden" name="investmenttotals|investmenttotal[${flag}${index}]@type" value="other"/>
				</td>
				<td align="center">
					<span   name="investmenttotals/investmenttotal[${flag}${index}]@seq_no" ><x:out select="$attendorg/@seq_no"/></span> 
				</td>
				<td >
				<input name="investmenttotals/investmenttotal[${flag}${index}]/source_name" class=" input_text" label="经费来源" value="<x:out select="$attendorg/source_name"/>" maxlength="50" style="width:80%">
				</td>
				<td >
				<input name="investmenttotals/investmenttotal[${flag}${index}]/year_one" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第一个年度的金额" value="<x:out select="$attendorg/year_one"/>" style="width:80%;text-align: right;">
				</td>
				<td >
				<input name="investmenttotals/investmenttotal[${flag}${index}]/year_two" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第二个年度的金额" value="<x:out select="$attendorg/year_two"/>" style="width:80%;text-align: right;">
				</td>
				<td >
				<input name="investmenttotals/investmenttotal[${flag}${index}]/year_three" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('investmenttotals_')" compute="investmenttotals_subitem" class=" input_text" label="第三个年度的金额" value="<x:out select="$attendorg/year_three"/>" style="width:80%;text-align: right;">
				</td>
				</tr>
			<c:set value="${index+1}" var="index" scope="page"/>
			</x:forEach>
	</table>
	<table cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
		<col width="5%"/>
		<col width="5%"/>
		<col width="30%"/>
		<col width="20%"/>
		<col width="20%"/>
		<col width="20%"/>
		<tr  align="center">
			<td align="center"  colspan="2" width="10%;">&nbsp; /</td>
			<td width="30%;">
				<span name="investmenttotals/investmenttotalsum/source_name" >总计</span>
			</td>
			<td colspan="3" width="60%;">
				<input name="investmenttotals/investmenttotalsum/year_total" class="gray" disabled  compute="investmenttotals_total" value="<x:out select="$xmlData/data/investmenttotals/investmenttotalsum/year_total"/>" style="width:80%;text-align: right;">
			</td>
		</tr>
	</table>
	<br/>
	<table width="98%" align="center" border="0">
		<tr style="border: 0"><td style="border: 0">
		<input class="button" name="cmdAddbefore" type=button value="添加" onclick="addNewRow('tblInvestmentTotal');try{top.resizeFrame();}catch(e){};">
		<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblInvestmentTotal','selAttendOrg')">
		<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblInvestmentTotal','selAttendOrg')">
		<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblInvestmentTotal','总投资规模，资金筹措方案，保障措施');computeSum('investmenttotals_');">
		</td></tr>
	</table>
<br/>
<div class="t_bar">资金支出预算（万元）</div>	
<table  id="tblOutPutBudget" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<col width="5%"/>
	<col width="5%"/>
	<col width="30%"/>
	<col width="30%"/>
	<col width="30%"/>
	<thead >
		<tr >
			<th class="TblHead" align="center"  >选择</th>
			<th class="TblHead" align="center" >序号</th>
			<th class="TblHead" align="center" >支出科目</th> 
			<th class="TblHead" align="center"  >支出金额</th>  
			<th class="TblHead" align="center"  >备注</th> 
		</tr>
	</thead>
	<tbody id="tab">
		<tr style="display:none"  align="center">
			<td align="center">&nbsp;
				<input type="radio" class="radiobutton" name="selOutPutBudget" >
			</td>
			<td align="center">&nbsp;
				<span name="outputbudgets|outputbudget[0]@seq_no" >[index]</span> 
			</td>
			<td align="center">
			<input name="outputbudgets|outputbudget[0]|out_subject" class=" input_text" label="支出科目" value="" maxlength="50" style="width:80%">
			</td>
			<td align="center">
			<input name="outputbudgets|outputbudget[0]|out_price"  label="支出金额" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('outputbudgets_')" compute="outputbudgets_subitem" class=" input_text"  value="" style="width:80%;text-align: right;">
			</td>
			<td align="center">
			<input name="outputbudgets|outputbudget[0]|out_remark" label="备注"  class=" input_text"  value="" maxlength="50" style="width:80%">
			</td>
		</tr>
		
	<c:set value="0" var="index" scope="page"/>
		<x:forEach select="$xmlData/data/outputbudgets/outputbudget" var="attendorg">
		
		<c:choose>
			<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
			<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
		</c:choose>
		<tr  align="center">
			<td>&nbsp;
				<input type="radio" class="radiobutton" name="selOutPutBudget" >
				<input type="hidden" name="outputbudgets|outputbudget[${flag}${index}]@type" value="other"/>
			</td>
			<td align="center">
				<span   name="outputbudgets/outputbudget[${flag}${index}]@seq_no" ><x:out select="$attendorg/@seq_no"/></span> 
			</td>
			<td >
			<input name="outputbudgets/outputbudget[${flag}${index}]/out_subject" class=" input_text" label="支出科目" value="<x:out select="$attendorg/out_subject"/>" maxlength="50" style="width:80%">
			</td>
			<td >
			<input name="outputbudgets/outputbudget[${flag}${index}]/out_price" label="支出金额" onfocus="InitInput.setNumber(this,7,2,2)" onchange="computeSum('outputbudgets_')" compute="outputbudgets_subitem" class=" input_text"  value="<x:out select="$attendorg/out_price"/>" style="width:80%;text-align: right;">
			</td>
			<td >
			<input name="outputbudgets/outputbudget[${flag}${index}]/out_remark" label="备注"  class=" input_text"  value="<x:out select="$attendorg/out_remark"/>" maxlength="50" style="width:80%">
			</td>
			</tr>
		<c:set value="${index+1}" var="index" scope="page"/>
		</x:forEach>
	</tbody>
</table>
<table cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
	<!-- <col width="5%"/>
	<col width="5%"/>
	<col width="30%"/>
	<col width="30%"/>
	<col width="30%"/> -->
	<tr  align="center">
		<td align="center"  colspan="2" width="10%">&nbsp; </td>
		<td width="30%">
		<span name="outputbudgets/outputbudgetsum/out_subject">总计</span>
		</td>
		<td colspan="2" width="60%">
		<input name="outputbudgets/outputbudgetsum/out_price" class="gray" disabled  compute="outputbudgets_total" value="<x:out select="$xmlData/data/outputbudgets/outputbudgetsum/out_price"/>" style="width:80%;text-align: right;">
		</td>
	</tr>
</table>
	<br/>
<table width="98%" align="center" border="0">
	<tr style="border: 0"><td style="border: 0">
	<input class="button" name="cmdAddbefore" type=button value="添加" onclick="addNewRow('tblOutPutBudget');try{top.resizeFrame();}catch(e){};">
	<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblOutPutBudget','selOutPutBudget')">
	<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblOutPutBudget','selOutPutBudget')">
	<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblOutPutBudget','资金支出预算');computeSum('outputbudgets_');">
	</td></tr>
</table>
<div class="t_bar">
	其中： 研究开发经费支出预算（万元）
</div>
<table class="t_css" width="100%" border="0" cellpadding="0"
	cellspacing="1" id="fundInfo">

	<tr class="t_tr">
		<td align="center" width="25%">支出科目</td>
		<td class="TblHead" align="center" width="20%">总预算</td>
	</tr>
	<tr >
		<td align="left" style=""><strong>一、直接费用</strong></td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[00]@invest_code" value="00" />
			<input type="hidden" name="budget/invest_detail/invest[00]/name" value="一、直接费用" />
			<input type="text" name="budget/invest_detail/invest[00]/total_invest" id="total_invest_0"
				   class="gray" disabled label="直接费用-->总预算"  style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='00']/total_invest" />" />
		</td>
	</tr>
	
	
	
	
	
	
	
	<tr >
		<td align="left" style="padding-left:20px">1、设备费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[01]@invest_code" value="01" />
			<input type="hidden" name="budget/invest_detail/invest[01]/name" value="1、设备费" />
			<input type="text" name="budget/invest_detail/invest[01]/total_invest" id="total_invest_1" 
				   class="gray" disabled label="设备费-->总预算"  style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='01']/total_invest" />" />
		</td>
	
	</tr>
	<tr >
		<td align="left" style="padding-left:40px">（1）购置设备费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[02]@invest_code" value="02" />
			<input type="hidden" name="budget/invest_detail/invest[02]/name" value="（1）购置设备费" />
			<input type="text" name="budget/invest_detail/invest[02]/total_invest" id="total_invest_2"
					 onfocus="InitInput.setNumber(this,7,2,2)" class=" valueGreatEqual:total_invest_2:total_fund_2"
				    label="购置设备费-->总预算"  style="text-align:right; width:150px;" 
				    onchange="countFundAuto('total_','invest_2,invest_3,invest_4','invest_1');
				     countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				     countFundAuto('total_','invest_0,invest_15','invest_18');" 
				    value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='02']/total_invest" />"/>
		</td>
	</tr>
	<tr >
		<td align="left" style="padding-left:40px">（2）自制设备费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[03]@invest_code"  value="03">
			<input type="hidden" name="budget/invest_detail/invest[03]/name" value="（2）自制设备费">
			<input type="text" name="budget/invest_detail/invest[03]/total_invest" id="total_invest_3"
				    onfocus="InitInput.setNumber(this,7,2,2)" class=" valueGreatEqual:total_invest_3:total_fund_3"
				    label="自制设备费-->总预算"  style="text-align:right; width:150px;"
				     onchange="countFundAuto('total_','invest_2,invest_3,invest_4','invest_1');
				     countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				   countFundAuto('total_','invest_0,invest_15','invest_18');"
				     value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='03']/total_invest" />"/>
		</td>
	</tr>
	<tr >
		<td align="left" style="padding-left:40px">（3）设备改造与租赁</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[04]@invest_code"  value="04">
			<input type="hidden" name="budget/invest_detail/invest[04]/name" value="（3）设备改造与租赁">
			<input type="text" name="budget/invest_detail/invest[04]/total_invest" id="total_invest_4" 
			         onfocus="InitInput.setNumber(this,7,2,2)" class=" valueGreatEqual:total_invest_4:total_fund_4"
				    label="设备改造与租赁-->总预算"  
				     onchange="countFundAuto('total_','invest_2,invest_3,invest_4','invest_1');
				     countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				   countFundAuto('total_','invest_0,invest_15','invest_18');"
				    style="text-align:right; width:150px;" 
				    value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='04']/total_invest" />"	/>
		</td>
	</tr>
	<tr >
		<td align="left" style="padding-left:20px">2、材料费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[05]@invest_code"  value="05">
			<input type="hidden" name="budget/invest_detail/invest[05]/name" value="2、材料费">
			<input type="text" name="budget/invest_detail/invest[05]/total_invest" id="total_invest_5" 
				    label="材料费-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)"  class="  valueGreatEqual:total_invest_5:total_fund_5"
				   style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='05']/total_invest" />" 
				   onchange="countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				     countFundAuto('total_','invest_0,invest_15','invest_18');"  />
		</td>
	</tr>
	<tr >
		<td align="left" style="padding-left:20px">3、测试化验加工费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[06]@invest_code"  value="06">
			<input type="hidden" name="budget/invest_detail/invest[06]/name" value="3、测试化验加工费">
			<input type="text" name="budget/invest_detail/invest[06]/total_invest" id="total_invest_6" 
				    label="测试化验加工费-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)" 
				   style="text-align:right; width:150px;" class="  valueGreatEqual:total_invest_6:total_fund_6"
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='06']/total_invest" />" 
				  onchange="countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				     countFundAuto('total_','invest_0,invest_15','invest_18');" />
		</td>
	</tr>
	<tr >
		<td align="left" style="padding-left:20px">4、燃料动力费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[07]@invest_code"  value="07">
			<input type="hidden" name="budget/invest_detail/invest[07]/name" value="4、燃料动力费">
			<input type="text" name="budget/invest_detail/invest[07]/total_invest" id="total_invest_7" 
				    label="燃料动力费-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)" class="  valueGreatEqual:total_invest_7:total_fund_7"
				   style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='07']/total_invest" />" 
				  onchange="countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				     countFundAuto('total_','invest_0,invest_15','invest_18');"  />
		</td>
	</tr>
	<tr >
		<td align="left" style="padding-left:20px">5、差旅费/会议费/国际合作与交流费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[08]@invest_code"  value="08">
			<input type="hidden" name="budget/invest_detail/invest[08]/name" value="差旅费/会议费/国际合作与交流费">
			<input type="text" name="budget/invest_detail/invest[08]/total_invest" id="total_invest_8" 
				    label="差旅费/会议费/国际合作与交流费-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)" class="  valueGreatEqual:total_invest_8:total_fund_8"
				   style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='08']/total_invest" />" 
				   onchange="countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				     countFundAuto('total_','invest_0,invest_15','invest_18');"  />
		</td>
	</tr>
	<%-- <tr >
		<td align="left" style="padding-left:20px">6、会议费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[09]@invest_code"  value="09">
			<input type="hidden" name="budget/invest_detail/invest[09]/name" value="6、会议费">
			<input type="text" name="budget/invest_detail/invest[09]/total_invest" id="total_invest_9" 
				    label="会议费-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)"  class="  valueGreatEqual:total_invest_9:total_fund_9"
				   style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='09']/total_invest" />" 
				  onchange="countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				     countFundAuto('total_','invest_0,invest_15','invest_18');"  />
		</td>
	</tr>
	<tr >
		<td align="left" style="padding-left:20px">7、国际合作与交流费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[10]@invest_code"  value="10">
			<input type="hidden" name="budget/invest_detail/invest[10]/name" value="7、国际合作与交流费">
			<input type="text" name="budget/invest_detail/invest[10]/total_invest" id="total_invest_10" 
				    label="国际合作与交流费-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)"  class="  valueGreatEqual:total_invest_10:total_fund_10"
				   style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='10']/total_invest" />" 
				   onchange="countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				     countFundAuto('total_','invest_0,invest_15','invest_18');"  />
		</td>
	</tr>
	<tr > --%>
		<td align="left" style="padding-left:20px">6、信息费（出版/文献/信息传播<br/>&nbsp;&nbsp;&nbsp;&nbsp;/知识产权事物费）</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[11]@invest_code"  value="11">
			<input type="hidden" name="budget/invest_detail/invest[11]/name" value="8、信息费（出版/文献/信息传播/知识产权事物费等）">
			<input type="text" name="budget/invest_detail/invest[11]/total_invest" id="total_invest_11" 
				    label="信息费（出版/文献/信息传播/知识产权事务费等）-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)" 
				   style="text-align:right; width:150px;" class="  valueGreatEqual:total_invest_11:total_fund_11"
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='11']/total_invest" />" 
					onchange="countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				     countFundAuto('total_','invest_0,invest_15','invest_18');"  />
		</td>
	</tr>
	
	
	<tr >
		<td align="left" style="padding-left:20px">7、专家咨询费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[12]@invest_code"  value="12">
			<input type="hidden" name="budget/invest_detail/invest[12]/name" value="9、专家咨询费">
			<input type="text" name="budget/invest_detail/invest[12]/total_invest" id="total_invest_12" 
				    label="专家咨询费-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)"  class="  valueGreatEqual:total_invest_12:total_fund_12"
				   style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='12']/total_invest" />" 
				onchange="countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				     countFundAuto('total_','invest_0,invest_15','invest_18');"  />
		</td>
	</tr>
	
	<tr >
		<td align="left" style="padding-left:20px">8、劳务费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[13]@invest_code"  value="13">
			<input type="hidden" name="budget/invest_detail/invest[13]/name" value="10、劳务费">
			<input type="text" name="budget/invest_detail/invest[13]/total_invest" id="total_invest_13" 
				    label="劳务费-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)" 
				   style="text-align:right; width:150px;" class="  valueGreatEqual:total_invest_13:total_fund_13"
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='13']/total_invest" />" 
				  onchange="countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				     countFundAuto('total_','invest_0,invest_15','invest_18');"  />
		</td>
	</tr>
	
	<tr >
		<td align="left" style="padding-left:20px">9、其他支出</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[14]@invest_code"  value="14">
			<input type="hidden" name="budget/invest_detail/invest[14]/name" value="11、其他支出">
			<input type="text" name="budget/invest_detail/invest[14]/total_invest" id="total_invest_14" 
				    label="其他支出-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)"  class="  valueGreatEqual:total_invest_14:total_fund_14"
				   style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='14']/total_invest" />" 
				   onchange="countFundAuto('total_','invest_1,invest_5,invest_6,invest_7,invest_8,invest_9,invest_10,invest_11,invest_12,invest_13,invest_14','invest_0'); 
				     countFundAuto('total_','invest_0,invest_15','invest_18');"  />
		</td>
	</tr>
	
	<tr >
		<td align="left" style=""><strong>二、间接费用</strong></td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[15]@invest_code"  value="15">
			<input type="hidden" name="budget/invest_detail/invest[15]/name" value="二、间接费用">
			<input type="text" name="budget/invest_detail/invest[15]/total_invest" id="total_invest_15" 
				   class="gray" disabled label="间接费用-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)" 
				   style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='15']/total_invest" />" />
		</td>
	</tr>
	<tr >
		<td align="left" style="padding-left:20px">1、管理费</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[16]@invest_code"  value="16">
			<input type="hidden" name="budget/invest_detail/invest[16]/name" value="1、管理费">
			<input type="text" name="budget/invest_detail/invest[16]/total_invest" id="total_invest_16" 
				    label="管理费-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)"  class="  valueGreatEqual:total_invest_16:total_fund_16"
				    onchange="countFundAuto('total_','invest_16,invest_17,,invest_19','invest_15');countFundAuto('total_','invest_0,invest_15','invest_18');"
				   style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='16']/total_invest" />"/>
		</td>
	</tr>
	
	<tr >
		<td align="left" style="padding-left:20px">2、绩效支出</td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[17]@invest_code"  value="17">
			<input type="hidden" name="budget/invest_detail/invest[17]/name" value="2、绩效支出">
			<input type="text" name="budget/invest_detail/invest[17]/total_invest" id="total_invest_17" 
				    label="绩效支出-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)"  class="  valueGreatEqual:total_invest_17:total_fund_17"
				    onchange="countFundAuto('total_','invest_16,invest_17,invest_19','invest_15');countFundAuto('total_','invest_0,invest_15','invest_18');"
				   style="text-align:right; width:150px;" 
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='17']/total_invest" />"/>
		</td>
	</tr>
	
	
	 <tr >
        <td align="left" style="padding-left:20px">3、其他</td>
        <td align="center">
            <input type="hidden" name="budget/invest_detail/invest[19]@invest_code" value="19">
            <input type="hidden" name="budget/invest_detail/invest[19]/name" value="3、其他">
            <input type="text" name="budget/invest_detail/invest[19]/total_invest" id="total_invest_19" 
                    label="其他-->概算金额"  onfocus="InitInput.setNumber(this,9,2,2)"  class=" valueGreatEqual:total_invest_19:total_fund_19"
                    onchange="countFundAuto('total_','invest_16,invest_17,invest_19','invest_15');countFundAuto('total_','invest_0,invest_15','invest_18');"
                   style="text-align:right; width:150px;" 
                   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='19']/total_invest" />"/>
        </td>
    </tr>
	
	
	<tr >
		<td align="left" ><strong>合计</strong></td>
		<td align="center">
			<input type="hidden" name="budget/invest_detail/invest[18]@invest_code"  value="18">
			<input type="hidden" name="budget/invest_detail/invest[18]/name" value="合计">
			<input type="text" name="budget/invest_detail/invest[18]/total_invest" id="total_invest_18" 
				    label="计划新增投资支出情况-->合计-->总预算"  onfocus="InitInput.setNumber(this,7,2,2)" 
				   style="text-align:right; width:150px;" 
				   class="gray" disabled
				   value="<x:out select="$xmlData/data/budget/invest_detail/invest[@invest_code='18']/total_invest" />" />
		</td>
	</tr>
</table>

<div class="t_bar">其中：拟添置的仪器设备经费预算</div>	
<table  id="tblEquipmentBudget" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
		<col width="5%"/>
		<col width="5%"/>
		<col width="20%"/>
		<col width="10%"/>
		<col width="10%"/>
		<col width="20%"/>
		<col width="10%"/>
		<col width="10%"/>
		<thead >
			<tr style="border:1px solid #B7D1E6">
				<th class="TblHead" align="center"  >选择</th>
				<th class="TblHead" align="center"  >序号</th>
				<th class="TblHead" align="center"  >设备名称  </th> 
				<th class="TblHead" align="center" >型号</th>  
				<th class="TblHead" align="center"  >数量</th> 
				<th class="TblHead" align="center"  >主要用途</th>
				<th class="TblHead" align="center"  >添置方式</th>
				<th class="TblHead" align="center"  >经费预算<br/>（万元）</th>  
			</tr>
		</thead>
		<tbody id="tab">
			<tr style="display:none"  align="center">
				<td align="center">&nbsp;
					<input type="radio" class="radiobutton" name="selEquipmentBudget" >
				</td>
				<td align="center">&nbsp;
					<span name="equipmentbudgets|equipmentbudget[0]@seq_no" >[index]</span> 
				</td>
				<td align="center">
				<input name="equipmentbudgets|equipmentbudget[0]|equipment_name" class=" input_text" label="设备名称" value="" maxlength="50" style="width:80%">
				</td>
				<td align="center">
				<input name="equipmentbudgets|equipmentbudget[0]|equipment_type" class=" input_text" label="型号" value="" maxlength="50" style="width:80%">
				</td>
				<td align="center">
				<input name="equipmentbudgets|equipmentbudget[0]|equipment_count" class=" input_text" label="数量" onfocus="InitInput.setNumber(this,3,0,0)" value="" maxlength="50" style="width:80%;text-align: right;">
				</td>
				<td align="center">
				<input name="equipmentbudgets|equipmentbudget[0]|equipment_purpose" class=" input_text" label="主要用途" value="" maxlength="50" style="width:80%">
				</td>
				<td align="center">
				
					<cpt:select id="acquire_way_[index]"   key="acquire_way" name="acquire_way"  value="" onChange="initControlValue(this.id);"></cpt:select>
					<input type="hidden" name="equipmentbudgets|equipmentbudget[0]|acquire_way_value" class="" value="" label="添置方式">
					<input type="hidden" name="equipmentbudgets|equipmentbudget[0]|acquire_way_name" value="">
				<!-- <input name="equipmentbudgets|equipmentbudget[0]|acquire_way" class=" input_text" label="添置方式" value="" maxlength="50" style="width:80%"> -->
				</td>
				<td align="center">
				<input name="equipmentbudgets|equipmentbudget[0]|equipment_price" onfocus="InitInput.setNumber(this,7,2,2)"  class=" input_text" label="经费预算" value="" maxlength="50" style="width:80%;text-align: right;">
				</td>
			</tr>
			
		<c:set value="0" var="index" scope="page"/>
			<x:forEach select="$xmlData/data/equipmentbudgets/equipmentbudget" var="attendorg">
			
			<c:choose>
				<c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
				<c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
			</c:choose>
			<tr  align="center">
				<td>&nbsp;
					<input type="radio" class="radiobutton" name="selEquipmentBudget" >
					<input type="hidden" name="equipmentbudgets|equipmentbudget[${flag}${index}]@type" value="other"/>
				</td>
				<td align="center">
					<span   name="equipmentbudgets/equipmentbudget[${flag}${index}]@seq_no" ><x:out select="$attendorg/@seq_no"/></span> 
				</td>
				<td >
				<input name="equipmentbudgets/equipmentbudget[${flag}${index}]/equipment_name" class=" input_text" label="设备名称" value="<x:out select="$attendorg/equipment_name"/>" maxlength="50" style="width:80%">
				</td>
				<td >
				<input name="equipmentbudgets/equipmentbudget[${flag}${index}]/equipment_type" class=" input_text" label="型号" value="<x:out select="$attendorg/equipment_type"/>" maxlength="50" style="width:80%">
				</td>
				<td >
				<input name="equipmentbudgets/equipmentbudget[${flag}${index}]/equipment_count" onfocus="InitInput.setNumber(this,3,0,0)" class=" input_text" label="数量" value="<x:out select="$attendorg/equipment_count"/>" maxlength="50" style="width:80%;text-align: right;">
				</td>
				<td >
				<input name="equipmentbudgets/equipmentbudget[${flag}${index}]/equipment_purpose" class=" input_text" label="主要用途" value="<x:out select="$attendorg/equipment_purpose"/>" maxlength="50" style="width:80%;text-align: right;">
				</td>
				<td >
				
				<c:set var="acquire_way"><x:out select="$attendorg/acquire_way_value" /></c:set>
				<cpt:select id="acquire_way_${flag}${index}" name="acquire_way"  key="acquire_way"  value="${acquire_way}" onChange="initControlValue(this.id);"></cpt:select>
				<input type="hidden" name="equipmentbudgets/equipmentbudget[${flag}${index}]/acquire_way_value" class="" value="${acquire_way}" label="添置方式">
				<input type="hidden" name="equipmentbudgets/equipmentbudget[${flag}${index}]/acquire_way_name" value="<x:out select="$attendorg/acquire_way_name" />">
				
				<%-- <input name="equipmentbudgets/equipmentbudget[${flag}${index}]/acquire_way" class=" input_text" label="添置方式"acquire_way" class=" input_text" label="添置方式" value="<x:out select="$attendorg/acquire_way"/>" maxlength="50" style="width:80%"> --%>
				</td>
				<td >
				<input name="equipmentbudgets/equipmentbudget[${flag}${index}]/equipment_price" onfocus="InitInput.setNumber(this,7,2,2)"  class=" input_text" label="经费预算" value="<x:out select="$attendorg/equipment_price"/>" style="width:80%;text-align: right;">
				</td>
				</tr>
			<c:set value="${index+1}" var="index" scope="page"/>
			</x:forEach>
		</tbody>
	</table>
	<p>注：添置方式分为：国外引进、国内购置、自行研制。</p>
	<br/>
	<table width="98%" align="center" border="0">
		<tr style="border: 0"><td style="border: 0">
		<input class="button" name="cmdAddbefore" type=button value="添加" onclick="addNewRow('tblEquipmentBudget');try{top.resizeFrame();}catch(e){};">
		<input class="button" name="cmdMovePrev" type=button value="上移" onclick="movePrev('tblEquipmentBudget','selEquipmentBudget')">
		<input class="button" name="cmdMoveNext" type=button value="下移" onclick="moveNext('tblEquipmentBudget','selEquipmentBudget')">
		<input class="button" name="cmddel" type=button  value="删除" onclick="deleteSelectedRow('tblEquipmentBudget','拟添置的仪器设备经费预算');">
		</td></tr>
	</table>
<script type="text/javascript">
$(document).ready(function() {
var prp_version=$("#prp_version").text();

if(prp_version==""||prp_version==null){
	$("#budgetsMsg").find(":input").each(function(){
	$(this).val("0.00");	
	});
	
	$("#budgetsMsg1").find(":input").each(function(){
		$(this).val("0.00");	
		});
	
	$("#budgetsMsg2").find(":input").each(function(){
		$(this).val("0.00");	
		});
	
	$("#fundAdds").find(":input[type!=hidden]").each(function(){
		$(this).val("0.00");	
		});
}

/* var flag_shizhi = $("#flag_shizhi").val();
if(flag_shizhi ==  1){
	$("#source_city").attr("disabled",true);
    $("#source_city").addClass("gray");
}else{ */
	$("#source_city").attr("disabled",false);
/* 	$("#source_area").attr("disabled",true);
	$("#source_city").addClass("gray");
	$("#source_area").addClass("gray"); */
/* } */
	
});

function synchro(){
	var val = $("#source_apply").val();
	var xmjhtzze = $("#source_total").val();
	$("#sqje").val(formatNumberAuto(val+"", 7, 4, 2));
	$("#xmjhtzze").val(formatNumberAuto(xmjhtzze+"", 7, 4, 2));
}

function setSource(val){
	var areaNo = $("input[name$='area_no']").val();
	var flag_shizhi = $("#flag_shizhi").val();
	if(flag_shizhi ==  1){
		if((formatNumberAuto(val+"", 7, 4, 2)*10000)%10000!=0)
			$("#source_city").val(formatNumberAuto(val+"0000", 7, 4, 2));
		else
			$("#source_city").val(formatNumberAuto(val+".0000", 7, 4, 2));
		$("#source_area").val("0.00");
	}else{
		if(areaNo == '320202' || areaNo == '320204' || areaNo == '320203'){
			
		if((formatNumberAuto(val*0.8+"", 7, 4, 2)*10000)%10000!=0)
			$("#source_city").val(formatNumberAuto(val*0.8+"0000", 7, 4, 2));
		else
			$("#source_city").val(formatNumberAuto(val*0.8+".0000", 7, 4, 2));
		
		
		if((val*10000-formatNumberAuto(val*0.8+"", 7, 4, 2)*10000)%10000!=0){
		 	$("#source_area").val(formatNumberAuto(((val*10000-formatNumberAuto(val*0.8+"", 7, 4, 2)*10000)/10000)+"0000", 7, 4, 2));
		}else{
			$("#source_area").val(formatNumberAuto(((val*10000-formatNumberAuto(val*0.8+"", 7, 4, 2)*10000)/10000)+".0000", 7, 4, 2));
		}
		}else if(areaNo == '320205' || areaNo == '320206' || areaNo == '320211' || areaNo == '320212'){
			//$("#source_city").val(formatNumberAuto(val*0.5+"", 7, 4, 2));
			if((formatNumberAuto(val*0.5+"", 7, 4, 2)*10000)%10000!=0)
				$("#source_city").val(formatNumberAuto(val*0.5+"0000", 7, 4, 2));
			else
				$("#source_city").val(formatNumberAuto(val*0.5+".0000", 7, 4, 2));
			
			if((val*10000-formatNumberAuto(val*0.5+"", 7, 4, 2)*10000)%10000!=0){
				$("#source_area").val(formatNumberAuto(((val*10000-formatNumberAuto(val*0.5+"", 7, 4, 2)*10000)/10000)+"0000", 7, 4, 2));
			}else
				$("#source_area").val(formatNumberAuto(((val*10000-formatNumberAuto(val*0.5+"", 7, 4, 2)*10000)/10000)+".0000", 7, 4, 2));
		}else if(areaNo == '320281' || areaNo == '320282'){
			//$("#source_city").val(formatNumberAuto(val*0.2+"", 7, 4, 2));
			if((formatNumberAuto(val*0.2+"", 7, 4, 2)*10000)%10000!=0)
				$("#source_city").val(formatNumberAuto(val*0.2+"0000", 7, 4, 2));
			else
				$("#source_city").val(formatNumberAuto(val*0.2+".0000", 7, 4, 2));
			if((val*10000-formatNumberAuto(val*0.2+"", 7, 4, 2)*10000)%10000!=0){
				$("#source_area").val(formatNumberAuto(((val*10000-formatNumberAuto(val*0.2+"", 7, 4, 2)*10000)/10000)+"0000", 7, 4, 2));
			}else{
				$("#source_area").val(formatNumberAuto(((val*10000-formatNumberAuto(val*0.2+"", 7, 4, 2)*10000)/10000)+".0000", 7, 4, 2));
				
			}
		}
	}
}

function  countProvince(id1,id2){
	var val1 = $("#"+id1).val();
	if(!$.isNumeric(val1)){
		val1 = '';
	}
	$("#"+id2).val(formatNumberAuto(val1+".0000", 7, 4, 2));
}

function countFundAuto(idStart, countStr, totalStr) {
	var indexs = countStr.split(",");
	var count = 0;
	for ( var i = 0; i < indexs.length; i++) {
		var fund = $("#" + idStart + indexs[i]).val();
		if (!$.isNumeric(fund))
			fund = "0";
		count = ((parseFloat(count)*10000 + parseFloat(fund)*10000)/10000).toFixed(4);
		
	}
	
	
	count = formatNumberAuto(count.toString(), 9, 4, 2);// 格式化金额
	
	//add by cg 扩展：对于多个输入框所求得的和，同时赋给某几个文本框
	var totalStrArr = totalStr.split(",");
	var totalId;
	for(var i = 0;i < totalStrArr.length; i++ ) {
		totalId = totalStrArr[i];
	/* if(count == "0.00"){
		count="";
	} */	
	$("#" + idStart + totalId).val(count);
	}
}
function computeSum(compute){
	var count = 0;
	$("input[compute='"+compute+"subitem']").each(function(){
		var fund = $(this).val();
		if (!$.isNumeric(fund))
			fund = "0";
		count = ((parseFloat(count)*10000 + parseFloat(fund)*10000)/10000).toFixed(4);
	});
	count = formatNumberAuto(count.toString(), 9, 4, 2);
	
	$("input[compute='"+compute+"total']").val(count);
}
</script>
